﻿using SimpleInjector;
using Sustainalytics.Synchronization.Interface;
using System.Collections.Generic;
using System.Diagnostics;
using Xunit.Abstractions;

namespace Sustainalytics.ClientDW.Synchronization.SyncRiskRatingsData.Tests
{
    public abstract class BaseSyncRiskRatingTests : ILogger
    {
        protected Container SimpleInjectorContainer;

        private readonly ITestOutputHelper output;

        protected readonly Dictionary<string, string> gaConnectionStrings = new Dictionary<string, string>
        {
            { "ClientDW", "mongodb://localhost:27017/ClientDW_A" },
            { "RiskRatingsResearchDW", "mongodb://localhost:27017/RiskRatingsResearchDW_A" },
            { "GovernanceDW", "mongodb://localhost:27017/GovernanceDW_A" },
        };

        protected BaseSyncRiskRatingTests(ITestOutputHelper output)
        {
            Debug.Listeners.Add(new DefaultTraceListener());
            this.output = output;
            SimpleInjectorContainer = SimpleInjectorConfig.Register(this, gaConnectionStrings);
        }

        public void Log(string message)
        {
            output.WriteLine(message);
        }
    }
}
